﻿using System.ServiceModel;
using CrmService.Models.Data;
using System.Collections.Generic;

namespace CrmService.Services
{
    /// <summary>
    ///     This interface interacts with the Repository to perform CRUD operations on the 
    ///     Crm DB.
    /// </summary>
    [ServiceContract]
    public interface ICrmDataService
    {
        /// <summary>
        ///     Method to add ideas to the CrmDatabase
        /// </summary>
        /// <param name="ideas">
        ///     The ideas to be added
        /// </param>
        [OperationContract]
        void AddIdeas(IEnumerable<Idea> ideas);

        /// <summary>
        ///     Method to get the approved/rejected ideas from the Crm Database
        /// </summary>
        /// <returns>
        ///     List of accepted/rejected ideas.
        /// </returns>
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", 
            Justification = "Method use is appropriate considering complexity and logic http://msdn.microsoft.com/en-us/library/bzwdh01d(VS.71).aspx#cpconpropertyusageguidelinesanchor1"), OperationContract]
        IEnumerable<Idea> GetSyncedIdeas();

        /// <summary>
        ///     Method to get the list of successfully synced ideas so they
        ///     can be removed from the Crm DB
        /// </summary>
        /// <param name="ideas">
        ///     The list of successfully synced ideas
        /// </param>
        [OperationContract]
        void IdeasSuccessfullySynced(IEnumerable<Idea> ideas);

        /// <summary>
        ///     Method to get the list of ideas to be approved/rejected
        /// </summary>
        /// <returns>
        ///     The list of ideas to be approved/rejected
        /// </returns>
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate",
            Justification = "Method use is appropriate considering complexity and logic http://msdn.microsoft.com/en-us/library/bzwdh01d(VS.71).aspx#cpconpropertyusageguidelinesanchor1"), OperationContract]
        IEnumerable<Idea> GetIdeasForApproval();

        /// <summary>
        ///     Method to mark an idea as accepted
        /// </summary>
        /// <param name="ideaId">
        ///     Idea that has been accepted
        /// </param>
        [OperationContract]
        void AcceptIdea(int ideaId);

        /// <summary>
        ///     Method to mark an idea as reviewing
        /// </summary>
        /// <param name="ideaId">
        ///     Idea that has been accepted
        /// </param>
        [OperationContract]
        void ResetToReview(int ideaId);
        /// <summary>
        ///     Method to mark an idea as rejected
        /// </summary>
        /// <param name="ideaId">
        ///     Idea that has been rejected
        /// </param>
        /// <param name="rejectionReason">
        ///     Reason for rejection
        /// </param>
        [OperationContract]
        void RejectIdea(int ideaId, string rejectionReason);
    }


   
}
